import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import com.sun.swing.internal.plaf.synth.resources.synth;


public class ThreadManager {

	private final static int threadNum=10;
	private static volatile ThreadManager threadManager;
	private ExecutorService executorService;
	
	private ThreadManager(){
		executorService = Executors.newFixedThreadPool(threadNum);
	}
	
	public static ThreadManager getInstance(){
		if(threadManager==null){
			synchronized (ThreadManager.class) {
				if(threadManager==null){
					threadManager = new ThreadManager();
				}
			}
			
		}
		return threadManager;
	}
	
	public void executor(Runnable runnable){
		executorService.execute(runnable);
	}
}
